package com.plian.system.entity.pf;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.plian.Tools.DateUtil;
import com.plian.system.mybatis.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/**
 * @description: 职工工资发放主表_集团
 * @author: gangan
 * @create: 2020-05-28 16:50
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName("pf_base_grant_salary")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "BaseGrantSalary对象", description = "职工工资发放主表")
public class BaseGrantSalary extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 单据编码
     */
    @ApiModelProperty(value = "单据编码")
    private String code;

    /**
     * 填报年月
     */
    @ApiModelProperty(value = "填报年月", required = true)
    private String fillingMonth;

    /**
     * 填报单位
     */
    @ApiModelProperty(value = "填报单位")
    private String fillingUnitId;

    /**
     * 审批人
     */
    @ApiModelProperty(value = "审批人")
    private String approvedUser;

    /**
     * 审批时间
     */
    @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
    @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
    @ApiModelProperty(value = "审批时间")
    private Date approvedTime;

    /**
     * 审批意见
     */
    @ApiModelProperty(value = "审批意见")
    private String approvedOpinion;

    /**
     * 单据类型
     */
    @ApiModelProperty(value = "单据类型")
    private String formType;

    /**
     * 1单户表 2汇总表
     */
    @ApiModelProperty(value = "1单户表 2汇总表", required = true)
    private Integer type;

    @TableField(exist = false)
    @ApiModelProperty(value = "子表")
    private List<GrantSalary> grantSalaries;

    @TableField(exist = false)
    @ApiModelProperty(value = "汇总勾选id")
    private List<String> childIds;

    /**
     * 数据来源 null为系统填报 对应用户id
     */
    @ApiModelProperty(value = "数据来源 null为系统填报 对应用户id", required = true)
    private String dataSource;

    /**
     * 数据来源id
     */
    @ApiModelProperty(value = "数据来源id", required = true)
    private String dataSourceId;
}
